﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Web.Http;
using Sovigaz.DataProvider;
using Utilities;

namespace Sovigaz.Api
{
    public class SitemapApiController : ApiController
    {
        public List<Sitemap> Get(string id)
        {
            try
            {
                return MvcApplication.SiteMaps.Where(p => p.ParentID == id).ToList();
            }
            catch (Exception e)
            {
                throw ExceptionHelper.CreateHttpResponseException("Có lỗi xảy ra khi truy xuất dữ liệu.", e);
            }
        }
    }
}